package com.bytedance.scenedemo.lifecycle;

import com.bytedance.scene.Scene;
import com.bytedance.scenedemo.ResourceTable;
import com.bytedance.scenedemo.view.ClassPathInfoTextView;
import ohos.aafwk.content.Intent;
import ohos.agp.colors.RgbColor;
import ohos.agp.components.*;
import ohos.agp.components.element.ShapeElement;
import ohos.agp.utils.Color;

public class EmptyScene extends Scene {

    private Text text;

    @Override
    public Component onCreateView(LayoutScatter scatter, ComponentContainer container, Intent intent) {
        return scatter.parse(ResourceTable.Layout_basic_layout, container, false);
    }

    @Override
    public void onActivityCreated(Intent intent) {
        super.onActivityCreated(intent);
        text = (Text) getView().findComponentById(ResourceTable.Id_name);
        ClassPathInfoTextView classPathInfoTextView = (ClassPathInfoTextView) getView().findComponentById(ResourceTable.Id_class_path_info);
        classPathInfoTextView.setText(this.getClass().getName());
        Button btn = (Button) getView().findComponentById(ResourceTable.Id_btn);
        btn.setVisibility(Component.HIDE);
    }

    @Override
    public void onResume() {
        super.onResume();
        text.setText(getStateHistory());
    }
}
